home *** CD-ROM | disk | FTP | other *** search
/ Joystick Magazine 1995 July & August / cd No4 joystick No62.iso / mac / pc / SHARE / LIGHTLIB / LANGUAGE.Z / LLID.CPP < prev    next >
C/C++ Source or Header  |  1995-02-09  |  5KB  |  194 lines

  1. // LLID.cpp : Defines the class behaviors for the application.
  2. //
  3.  
  4.  
  5. #include "stdafx.h"
  6.  
  7. extern "C"   // include the LightLibImage - header file here
  8. {
  9. #include "LLI.H"
  10. }
  11.  
  12. #include "LLID.h"
  13.  
  14. #include "mainfrm.h"
  15. #include "LLIDdoc.h"
  16. #include "LLIDview.h"
  17.  
  18.  
  19. #ifdef _DEBUG
  20. #undef THIS_FILE
  21. static char BASED_CODE THIS_FILE[] = __FILE__;
  22. #endif
  23.  
  24. /////////////////////////////////////////////////////////////////////////////
  25. // CLLIDApp
  26.  
  27. BEGIN_MESSAGE_MAP(CLLIDApp, CWinApp)
  28.  //{{AFX_MSG_MAP(CLLIDApp)
  29.  ON_COMMAND(ID_APP_ABOUT, OnAppAbout)
  30.   // NOTE - the ClassWizard will add and remove mapping macros here.
  31.   //    DO NOT EDIT what you see in these blocks of generated code!
  32.  //}}AFX_MSG_MAP
  33.  // Standard file based document commands
  34.  ON_COMMAND(ID_FILE_NEW, CWinApp::OnFileNew)
  35.  ON_COMMAND(ID_FILE_OPEN, CWinApp::OnFileOpen)
  36.  // Standard print setup command
  37.  ON_COMMAND(ID_FILE_PRINT_SETUP, CWinApp::OnFilePrintSetup)
  38. END_MESSAGE_MAP()
  39.  
  40. /////////////////////////////////////////////////////////////////////////////
  41. // CLLIDApp construction
  42.  
  43. CLLIDApp::CLLIDApp()
  44. {
  45.  // TODO: add construction code here,
  46.  // Place all significant initialization in InitInstance 
  47. }
  48.  
  49. /////////////////////////////////////////////////////////////////////////////
  50. // The one and only CLLIDApp object
  51.  
  52. CLLIDApp NEAR theApp;
  53.  
  54. /////////////////////////////////////////////////////////////////////////////
  55. // CLLIDApp initialization
  56.  
  57.  
  58. BOOL CLLIDApp::InitInstance()
  59. {
  60.  // Standard initialization
  61.  // If you are not using these features and wish to reduce the size
  62.  //  of your final executable, you should remove from the following
  63.  //  the specific initialization routines you do not need.
  64.  
  65.  SetDialogBkColor();        // Set dialog background color to gray
  66.  LoadStdProfileSettings();  // Load standard INI file options (including MRU)
  67.  
  68.  
  69.  // Register the application's document templates.  Document templates
  70.  //  serve as the connection between documents, frame windows and views.
  71.  
  72.     // enable TIF fileformat
  73.     CMultiDocTemplate* pDocTemplateTIF;
  74.     pDocTemplateTIF = new CMultiDocTemplate(
  75.         IDR_TIFTYPE,
  76.         RUNTIME_CLASS( CLLIDDoc ),
  77.         RUNTIME_CLASS( CMDIChildWnd ),        // standard MDI child frame
  78.         RUNTIME_CLASS( CLLIDView ) );
  79.  
  80.     // enable GIF fileformat
  81.     CMultiDocTemplate* pDocTemplateGIF;
  82.     pDocTemplateGIF = new CMultiDocTemplate(
  83.         IDR_GIFTYPE,
  84.         RUNTIME_CLASS( CLLIDDoc ),
  85.         RUNTIME_CLASS( CMDIChildWnd ),        // standard MDI child frame
  86.         RUNTIME_CLASS( CLLIDView ) );
  87.     
  88.     // enable BMP fileformat
  89.     CMultiDocTemplate* pDocTemplateBMP;
  90.     pDocTemplateBMP = new CMultiDocTemplate(
  91.         IDR_BMPTYPE,
  92.         RUNTIME_CLASS( CLLIDDoc ),
  93.         RUNTIME_CLASS( CMDIChildWnd ),        // standard MDI child frame
  94.         RUNTIME_CLASS( CLLIDView ) );
  95.     
  96.     // enable JPG fileformat
  97.     CMultiDocTemplate* pDocTemplateJPG;
  98.     pDocTemplateJPG = new CMultiDocTemplate(
  99.         IDR_JPGTYPE,
  100.         RUNTIME_CLASS( CLLIDDoc ),
  101.         RUNTIME_CLASS( CMDIChildWnd ),        // standard MDI child frame
  102.         RUNTIME_CLASS( CLLIDView ) );
  103.  
  104.     // enable PCX fileformat
  105.     CMultiDocTemplate* pDocTemplatePCX;
  106.     pDocTemplatePCX = new CMultiDocTemplate(
  107.         IDR_PCXTYPE,
  108.         RUNTIME_CLASS( CLLIDDoc ),
  109.         RUNTIME_CLASS( CMDIChildWnd ),        // standard MDI child frame
  110.         RUNTIME_CLASS( CLLIDView ) );
  111.  
  112.  
  113.     AddDocTemplate( pDocTemplateTIF );
  114.     AddDocTemplate( pDocTemplateGIF );
  115.     AddDocTemplate( pDocTemplateBMP );
  116.     AddDocTemplate( pDocTemplateJPG );
  117.     AddDocTemplate( pDocTemplatePCX );
  118.  
  119.  // create main MDI Frame window
  120.     CMainFrame* pMainFrame = new CMainFrame;
  121.     if (!pMainFrame->LoadFrame(IDR_MAINFRAME))
  122.         return FALSE;
  123.     m_pMainWnd = pMainFrame;
  124.     
  125.     pMainFrame->DragAcceptFiles();      // allow Drag and Drop from FileManager
  126.  
  127.  
  128.  if (m_lpCmdLine[0] != '\0')
  129.  {
  130.   // TODO: add command line processing here
  131.  }
  132.   
  133.   
  134.  // The main window has been initialized, so show and update it.
  135.  pMainFrame->ShowWindow(m_nCmdShow);
  136.  pMainFrame->UpdateWindow();
  137.  
  138.  return TRUE;
  139. }
  140.  
  141. /////////////////////////////////////////////////////////////////////////////
  142. // CAboutDlg dialog used for App About
  143.  
  144. class CAboutDlg : public CDialog
  145. {
  146. public:
  147.  CAboutDlg();
  148.  
  149. // Dialog Data
  150.  //{{AFX_DATA(CAboutDlg)
  151.  enum { IDD = IDD_ABOUTBOX };
  152.  //}}AFX_DATA
  153.  
  154. // Implementation
  155. protected:
  156.  virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
  157.  //{{AFX_MSG(CAboutDlg)
  158.   // No message handlers
  159.  //}}AFX_MSG
  160.  DECLARE_MESSAGE_MAP()
  161. };
  162.  
  163. CAboutDlg::CAboutDlg() : CDialog(CAboutDlg::IDD)
  164. {
  165.  //{{AFX_DATA_INIT(CAboutDlg)
  166.  //}}AFX_DATA_INIT
  167. }
  168.  
  169. void CAboutDlg::DoDataExchange(CDataExchange* pDX)
  170. {
  171.  CDialog::DoDataExchange(pDX);
  172.  //{{AFX_DATA_MAP(CAboutDlg)
  173.  //}}AFX_DATA_MAP
  174. }
  175.  
  176. BEGIN_MESSAGE_MAP(CAboutDlg, CDialog)
  177.  //{{AFX_MSG_MAP(CAboutDlg)
  178.   // No message handlers
  179.  //}}AFX_MSG_MAP
  180. END_MESSAGE_MAP()
  181.  
  182. // App command to run the dialog
  183. void CLLIDApp::OnAppAbout()
  184. {
  185.  CAboutDlg aboutDlg;
  186.  aboutDlg.DoModal();
  187. }
  188.  
  189. /////////////////////////////////////////////////////////////////////////////
  190. // CLLIDApp commands
  191.  
  192.  
  193.  
  194.